#ifndef utils_hpp
#define utils_hpp

#include <string>
#include <iostream>

void fatal_error(std::string msg);
double randunity();
double fastabs(double x);
double fastsign(double x);
double fastmin(double a, double b);
double fastmax(double a, double b);
bool line_line_intersect(double x1, double y1, double x2, double y2, double u1, double v1, double u2, double v2, double &xint, double &yint, double &t, double &u);
double* linspace(double x1, double x2, unsigned npts);
bool linearIntervalSearch(double *array, int size, double value, unsigned &position);
bool binaryIntervalSearch(double *array, int size, double value, unsigned& position);

#endif
